(C) Qualified employer plan. -- The term "qualified employer plan" has the meaning given to such term by subsection (p)(3)(A)(i).
(D) Government plan. -- The term "government plan" has the meaning given such term by subsection (p)(3)(B).
(6) Ordering rules. -- Unless the plan specifies otherwise, any distribution from such plan shall not be treated a being made form the accumulated deductable employee contributions until all other amounts to the credit of the employee have been distributed.
(p) Loans treated as distributions. -- For purposes of this section --
(1) Treatment as distributions. --
(A) Loans. -- If during any taxable year a participant or beneficiary receives (directly or indirectly) any amount as a loan form a qualified employer plan, such amount shall be treated as having been received by such individual as a distribution under such plan.
(B) Assignments or pledges. -- If during any taxable year a participant or beneficiary assigns (or agrees to assign) or pledges (or agrees to pledge) any portion of his interest in a qualified employer plan, such portion shall be treated as having been received by such individual as a loan form such plan.
(2) Exception for certain loans. --
(A) General rule. -- Paragraph (1) shall not apply to any loan to the extent that such loan (when added to the outstanding balance of all other loans form such plan whether made on, before or after August 13, 1982), does not exceed the lesser of --
(i) $50,000, reduced by the excess (if any) of --
(I) the highest outstanding balance of loans from the plan during the 1-year period ending on the day before the date on which such loan was made, over
(II) the outstanding balance of loans from the plan on the date on which such loan was made, or
(ii) the greater of (I) one-half of the present value of the nonforfeitable accrued benefit of the employee under the plan, or (II) $10,000.
For purposes of clause (ii), the present value of the nonforfeitable accrued benefit shall be determined without regard to any accumulated deductible employee contributions (as defined in subsection (o)(5)(B)).
(B) Requirement that loan be repayable within 5 year.--
(i) In general. -- Subparagraph (A) shall not apply to any loan unless such loan, by its terms, is required to be repaid within 5 years.
(ii) Exception for home loans. -- Clause (i) shall not apply to any loan used to acquire any dwelling unit which within a reasonable time is to be used (determined at the time the loan is made) as the principal residence of the participant.
(C) Requirement of level amortization. -- Except as provided in regulations, this paragraph shall not apply to any loan unless substantially level amortization of such loan (with payments not less frequently than quarterly) is required over the term of the loan.
(D) Related employers and related plans. -- For purposes of this paragraph --
(i) the rules of subsections (b), (c), and (m) of section 414 shall apply, and
(ii) all plans of an employer (determined after the application of such subsections) shall be treated as 1 plan.
(3) Denial of interest deductions in certain cases. --
(A) In general. -- No deduction otherwise allowable under this chapter shall be allowed under this chapter for any interest paid or accrued on any loan to which paragraph (1) does not apply by reason of paragraph (2) during the period described in subparagraph (B).
(B) Period to which subparagraph (A) applies. -- For purposes of subparagraph (A), the period described in this subparagraph is the period --
(i) on or after the 1st day on which the individual to whom the loan is made is a key employee (as defined in section 416(i)), or
(ii) such loan is secured by amounts attributable to elective deferrals described in subparagraph (A) or (C) of section 402(g)(3).
(4) Qualified employer plan, etc. -- For purposes of this subsection --
(A) Qualified employer plan. --
(i) In general. -- The term "qualified employer plan" means --
(I) a plan described in section 401(a) which includes a trust exempt form tax under section 501(a),
(II) an annuity plan describe in section 403(a), and
(III) a plan under which amounts are contributed by an individual's employer for an annuity contract described in section 403(b).
(ii) Special rules. -- The term "qualified employer plan" --
(I) shall include any plan which was (or was determined to be) a qualified employer plan or a government plan, but
(II) shall not include a plan described in subsection (e)(7).
(B) Government plan. -- The term "government plan" means any plan whether or not qualified, established and maintained for its employees by the United States, by a State or political subdivision thereof, or by an agency or instrumentality of any of the foregoing.
(5) Special rules for loans, etc., from certain contracts. -- For purposes of this subsection, any amount received as a loan under a contract purchased under a qualified employer plan (and any assignment or pledge with respect to such a contract) shall be treated as a loan under such employer plan.
(q) 10-percent penalty for premature distributions fro annuity contracts. --
(1) Imposition of penalty. -- If any taxpayer receives any amount under an annuity contract, the taxpayer's tax under this chapter for the taxable year in which such amount is received shall be increased by an amount equal to 10 percent of the portion of such amount which is includable in gross income.
(2) Subsection not to apply to certain distributions. -- Paragraph (1) shall not apply to any distribution --(A) made on or after the date on which the taxpayer attains age 59 1/2
(B) made on or after the death of the holder (or, where the holder is not an individual, the death of the primary annuitant (as defined in subsection (s)(6)(B)),
(C) attributable to the taxpayer's becoming disabled within the meaning of subsection (m)(7),
(D) which is a part of a series of substantially equal periodic payment s(not less frequently than annually) made for the life (or life expectancy) of the taxpayer or the joint lives (or joint life expectancies) of such taxpayer and his designated beneficiary,
(E) from a plan, contract, account, trust, or annuity described in subsection (e)(5)(D),
(F) allocable to investment in the contract before August 14, 1982, or
(G) under a qualified funding asset (within the meaning of section 130(d), but without regard to whether there is a qualified assignment),
(H) to which subsection (t) applies (without regard to paragraph (2) thereof),
(I) under an immediate annuity contract (within the meaning of section 72(u)(4)), or
(J) which is purchased by an employer upon the termination of a plan described in section 401(a) or 403(a) and which is held by the employer until such time as the employee separates form service.
(3) Change in substantially equal payments. -- If --
(A) paragraph (1) does not apply to a distribution by reason of paragraph (2)(D), and
(B) the series of payment s under such paragraph are subsequently modified (other than by reason of death or disability) --
(i) before the close of the 5-year period beginning on the date of the first payment and after the taxpayer attains age 59 1/2, or
(ii) before the taxpayer attains age 59 1/2,
the taxpayer's tax for the 1st taxable year in which such modifications occurs shall be increased by an amount, determined under regulations, equal to the tax which (but for paragraph (2)(D)) would have been imposes, plus interest for the deferral period (within the meaning of subsection (t)(4)(B)).
(r) Certain railroad retirement benefits treated as received under employer plans. --
(1) In general. -- Notwithstanding any other provision of law, any benefit provided under the Railroad Retirement Act of 1974 (other than a tier 1 railroad retirement benefit) shall be treated for purposes of this title as a benefit provided under an employer plan which meets the requirements of section 401(a).
(2) Tier 2 taxes treated as contributions. --
(A) In general. -- For purposes of paragraph (1) --